<%--
  Created by IntelliJ IDEA.
  User: Lanan
  Date: 2018/1/10 0010
  Time: 15:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<html>
<head>
    <%@ include file="/commons/basejs.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>支付宝用户管理</title>
    <script type="text/javascript">
        function formatterAliSex(gender) {
            if (gender == 'F') {
                return '女';
            } else if (gender == 'M') {
                return '男';
            }
        }

        function formatterAliImg(value){
            if(value!=null){
                return '<img height="40px" src="'+value+'" alt="" />';
            }else{
                return '';
            }
        }
        
        function formatterAliUserType(userType) {
            if (userType == '1') {
                return "公司账户";
            } else if (userType == '2') {
                return "个人账户";
            }
        }

        function searchAliPayCustomer() {
            var queryParams = {};
            queryParams.searchInfo = $("#searchAliInfo").val();
            $("#aliPay_customer_datagrid").datagrid('options').queryParams = queryParams;
            $("#aliPay_customer_datagrid").datagrid('getPager').data("pagination").options.pageNumber = 1;
            $("#aliPay_customer_datagrid").datagrid('clearSelections');
            var select = $('#aliPay_customer_datagrid').datagrid('getSelected');
            if(select != null){
                $('#aliPay_customer_datagrid').datagrid('clearSelections');
            }
            $("#aliPay_customer_datagrid").datagrid('reload');
        }

        function refreshAliPayCustomerList() {
            $('#aliPay_customer_datagrid').datagrid('reload')
        }

        function deleteAliPayCustomer() {
            lananDelete("aliPay_customer_datagrid", "确定要删除该支付宝用户信息？", "${path}/user/aliPayCustomer/delete.do");
        }

    </script>
</head>
<body>
<!-- 数据表格 begin -->
<table id="aliPay_customer_datagrid" title="微信用户列表" class="easyui-datagrid"
       data-options="
   		url:'${path}/user/aliPayCustomer/list.do',
		fit:true,
		idField:'id',
		rownumbers:true,
		toolbar:'#tools',
		pagination:true,
		fitColumns:true,
		singleSelect:true,
   		">
    <thead>
    <th data-options="field:'id', align:'center', checkbox:true">ID</th>
    <th data-options="field:'userName', align:'center'">用户名</th>
    <th data-options="field:'nickName', align:'center'">微信昵称</th>
    <th data-options="field:'userPhone', align:'center'">电话</th>
    <th data-options="field:'userEmail', align:'center'">Email</th>
    <th data-options="field:'userType', align:'center', formatter:formatterAliUserType">支付宝用户类型</th>
    <th data-options="field:'gender', align:'center', formatter:formatterAliSex">支付宝性别</th>
    <th data-options="field:'province', align:'center'">支付宝省</th>
    <th data-options="field:'city', align:'center'">支付宝城市</th>
    <th data-options="field:'avatar', align:'center', formatter:formatterAliImg">支付宝头像</th>
    <th data-options="field:'createTime', align:'center', formatter:formatDatebox">创建时间</th>
    </thead>
</table>
<div id="tools">
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'" onclick="refreshAliPayCustomerList()">刷新</a>

    <shiro:hasPermission name="/user/aliPayCustomer/delete.do">
        <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-remove'" onclick="deleteAliPayCustomer()">删除</a>
    </shiro:hasPermission>
    <label>搜索:</label>
    <input class="easyui-textbox" id="searchAliInfo" name="searchInfo" data-options="prompt:'请输入搜索关键字'"/>
    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="searchAliPayCustomer()">搜索</a>
</div>
<!-- 数据表格 end -->
</body>
</html>
